<template>
  <div class="icon-container" style="height:500px;overflow:auto">
    <div v-for="item of list" :key="item" @click="handleClipboard(item,$event)">
      <el-tooltip placement="top">
        <div slot="content">{{generateIconCode(item)}}</div>
        <div class="icon-item">
          <i :class="item.iconclass" aria-hidden="true" style="color:#606266"></i>
        </div>
      </el-tooltip>
    </div>
  </div>
</template>
<script>
// import { getIcon } from "@api/menu";
export default {
  name: "Icons",
  data() {
    return {
      list: null,
      listLoading: true,
    };
  },
  methods: {
    fetchDate() {
      this.listLoading = true;
    //   getIcon().then((res) => {
    //     this.listLoading = false;
    //     this.list = res.data;
    //   });
    },
    generateIconCode(item) {
      return `${item.iconClass}`;
    },
    handleClipboard(text, event) {
      this.$emit("setImgValue", text.iconClass);
    },
  },
};
</script>
<style lang="scss" scoped>
.icon-container {
  margin: 10px 0 0;
  overflow: hidden;
  .icon-item{
      margin: 5px;
      height: 20px;
      text-align: center;
      width: 20px;
      font-size: 20px;
      color: #24292e;
      cursor: pointer;
  }
  span{
      display: block;
      font-size: 16px;
      margin-top: 10px;
  }
  .disabled{
      pointer-events: none;
  }
}
</style>